package com.viewhigh.wechat.sdk.bean;


import java.io.Serializable;

import org.apache.commons.lang3.StringUtils;

/**
 * 
* @ClassName: AccountCacheBean 
* @Description: 缓存中的公众帐号信息
* @author liusongqing
* @date 2016年9月24日 上午11:07:27 
*
 */
public class AccountCacheBean implements Serializable {
    private static final long serialVersionUID = -7004854748642165022L;
    private String token;
    private String appId;
    private String appSecret;
    private String aeskey;// 加密的密钥，使用消息加密模式时用户自行设置
    private String handlerClassName;// 扩展自定义处理类(需实现IWeiXinHandlerService.class接口)

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public String getAppId() {
        return appId;
    }

    public void setAppId(String appId) {
        this.appId = appId;
    }

    public String getAppSecret() {
        return appSecret;
    }

    public void setAppSecret(String appSecret) {
        this.appSecret = appSecret;
    }

    public String getAeskey() {
        return aeskey;
    }

    public void setAeskey(String aeskey) {
        this.aeskey = aeskey;
    }

    public String getHandlerClassName() {
        return handlerClassName;
    }

    public void setHandlerClassName(String handlerClassName) {
        this.handlerClassName = handlerClassName;
    }

    public static long getSerialversionuid() {
        return serialVersionUID;
    }

    /**
     * 校验是否可用
     * 
     * @return
     */
    public boolean isAvailable() {
        if (StringUtils.isEmpty(token))
            return false;
        if (StringUtils.isEmpty(appId))
            return false;
        if (StringUtils.isEmpty(appSecret))
            return false;
        return true;
    }
}
